#include <getopt.h>
#include <stdio.h>

#include "jamunit.h"

int main(int argc, char *argv[]) {
	int c;
	opterr = 0;
	int tcase = -1;
	while ((c = getopt(argc, argv, "ir:")) != -1)
		switch (c) {
		case 'i':
			printf("Aspect name\t%s\n", aspect_name);
			return 0;
		case 'r':
			if (tcase == -1)
				tcase = atoi(optarg);
			else
				ferrf("extra -r option");
			break;
		case '?':
			switch (optopt) {
			case 'r':
				ferrf("-%c: argument required", optopt);
			default:
				ferrf("-%c: unknown option", optopt);
			}
		default:
			ferrf("unknown error (%s:%d)", __FILE__, __LINE__);
		}

	jamunit_init();
	jamunit_cases[tcase]();
	jamunit_cleanup();

	return 0;
}

